<?php 
require_once("../include/conn.php");

$nname=$_REQUEST['name'];
$id=$_REQUEST['id'];


switch ($nname){
case  "3":
$name="dt";
$cname="动态信息";
$sql_up="select * from $tb_dt  where id = $id ";
$cn_up=mysql_db_query($db_name,$sql_up);

break;
case  "4":
$name="rw";
$cname="任务指标";
$sql_up="select * from $tb_rw  where id = $id ";
$cn_up=mysql_db_query($db_name,$sql_up);

break;
case  "6":
$name="wd";
$cname="办理站文电";
$sql_up="select * from $tb_dz   where id = $id  ";
$cn_up=mysql_db_query($db_name,$sql_up);
}
$row_up = mysql_fetch_row($cn_up); 

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>更新职工天地</title>
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>

<body>
<form action="update_ok.php?id=<?php echo $id; ?>&name=<?php echo $nname; ?>" method="post" enctype="multipart/form-data" name="form1" onSubmit="return checked();" >
  <table width="100%"  border="0" cellpadding="0" cellspacing="8" class="tdbg">
    <tr>
      <th colspan="2" class="topbg">修改<?php echo $cname ?></th>
    </tr>
    <tr>
      <td width="119" align="right">标题：</td>
      <td width="846"><input name="title" type="text" id="title" value="<?php echo $row_up[1]; ?>"></td>
    </tr>
	<!-- 因为数据库中表设置不在同一表中，故此版没有加入下面功能 -->
    <!-- <tr>
      <td align="right">所属栏目：</td>
      <td>
       <select name="name" id="name">
        <option value="3" 
		<?php//  if($nname==3) {?> selected  <?php// }?>
		>动态信息</option>
        <option value="4" 
		<?php//  if($nname==4) {?> selected  <?php// }?>
		>任务指标</option>
        <option value="6" 
		<?php//  if($nname==6) {?> selected  <?php// }?>
		>办理站文电</option>
      </select>
       </td>
    </tr> -->
    <tr>
      <td align="right">日期：</td>
      <td><script src="../js/Calendar.js" type="text/javascript" language="javascript"></script>

        <input name="tdate" type="text" id="tdate"  onclick="SelectDate(this)" size="16" readonly="readonly"  value="<?php echo $row_up[4]; ?>">
	  </td>
    </tr>
    <tr>
      <td align="right">内容：</td>
      <td><input name="content" type="hidden" id="content" value="<?php echo htmlspecialchars($row_up[3]); ?>" >
	  <iframe id="content" src="editor/ewebeditor.html" frameborder="0" scrolling="no" width="550" height="350"></iframe>
	  </td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交">
        <input name="action" type="hidden" id="action" value="update">
      <input type="reset" name="Submit" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
